package org.yang.database.orm.entity;

import com.fasterxml.jackson.annotation.JsonInclude;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;
import java.util.List;

/**
 * key-value
 * @author: lslands
 * @description:
 * @version：v1.0
 * @date: 2024/6/11 21:53
 */
@Data
@NoArgsConstructor
public class Options<T> implements Serializable {

    /**
     * 选项的值
     */
    private T value;

    /**
     * 选项的标签
     */
    private String label;

    /**
     * 拓展字段
     */
    @JsonInclude(value = JsonInclude.Include.NON_EMPTY)
    private String expand;

    @JsonInclude(value = JsonInclude.Include.NON_EMPTY)
    private List<Options<T>> children;

    public Options(T value, String label) {
        this.value = value;
        this.label = label;
    }
    public Options(T value, String label, String expand) {
        this.value = value;
        this.label = label;
        this.expand=expand;
    }
    public Options(T value, String label, List<Options<T>> children) {
        this.value = value;
        this.label = label;
        this.children= children;
    }
    public Options(T value, String label, String expand, List<Options<T>> children) {
        this.value = value;
        this.label = label;
        this.expand=expand;
        this.children= children;
    }
}
